<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>get.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
     <script type="text/javascript" src="jquery-3.1.0.js"></script>
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<script type="text/javascript">
	
	$(function(){
		$("input[type='button']").click(function(){
			var addcode=$("#addCode").val();
			var url="http://restapi.amap.com/v3/ip";
			$.get(url,"key=a1a09a151cf59c39c01d5c10bfb7fbe4&ip="+addcode,function(msg){
				var ct=msg.province;
				var ci=msg.city;
				alert("当前地址:"+ct+ci);
			});
		});
	});
	
</script>	
  </head>
  
  <body>
   		<input id="addCode" type="text" value=""> <input type="button" value="地址">
  </body>
</html>
